package com.eastedu.controller;

import com.eastedu.domain.ObjectValueModel;
import com.eastedu.model.RequestParameter;
import com.eastedu.superise.handler.ulearning.LearningFileRestoreHistoricalDataHandler;
import lombok.RequiredArgsConstructor;
import org.springframework.http.HttpEntity;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 袁松明
 */
@RestController
@RequiredArgsConstructor
@RequestMapping(value = "/api/v1/learning/data-update")
public class LearningDataUpdateController {


    private final LearningFileRestoreHistoricalDataHandler learningFileRestoreHistoricalDataHandler;


    /**
     * 开放学校文件归档恢复
     * @param parameter RequestParameter
     * @return Boolean
     */
    @PostMapping("/restore-file-archive")
    public HttpEntity<ObjectValueModel<Boolean>> restoreFileArchive(RequestParameter parameter) {
        learningFileRestoreHistoricalDataHandler.handle(parameter);
        return ResponseEntity.ok(new ObjectValueModel<>(Boolean.TRUE));
    }

}
